﻿<c:WindowExt x:Class="personalplaner.gui.stamm.windows.EditDaysInMonth"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:bs="clr-namespace:personalplaner.business.stamm;assembly=personalplaner.business"
             xmlns:conv="clr-namespace:personalplaner.common.converters;assembly=personalplaner.common"
             xmlns:p="clr-namespace:personalplaner.gui.Properties"
             xmlns:vm="clr-namespace:personalplaner.common.mvvm.factory;assembly=personalplaner.common"
             xmlns:fac="clr-namespace:personalplaner.gui.stamm.viewmodels.factories"
             vm:ViewModelLoader.FactoryType="{x:Type fac:EditDaysInMonthModelFactory}"
             xmlns:c="clr-namespace:personalplaner.common.controls;assembly=personalplaner.common"
             ShowInTaskbar="False"
             WindowStartupLocation="CenterOwner"
             Height="500" Width="600" Foreground="#E1000000">

    <Window.Background>
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStop Color="White" Offset="0"/>
                <GradientStop Color="White" Offset="0.6"/>
                <GradientStop Color="#FFEDEDED" Offset="1"/>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>
    </Window.Background>

    <Control.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/personalplaner.common;component/resources/styles/WhiteStyleTemplates.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Control.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <!--<ColumnDefinition Width="130"/>-->
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>

        <TextBlock Text="Monate bearbeiten" FontSize="22" FontWeight="Thin" Foreground="#E1000000" Margin="50,-5,0,25" Grid.ColumnSpan="2"/>

        <Grid Grid.Column="2" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            
            <ListBox Grid.Row="1" Margin="20,0,0,0" BorderThickness="0,0,1,0"
                             ItemsSource="{Binding MonthList}"
                             SelectedItem="{Binding SelectedMonth}"
                             DisplayMemberPath="Name"/>

            <GroupBox Margin="5,0,5,0" BorderThickness="0" Grid.Column="1" Padding="5,0,5,5">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <TextBlock Text="{x:Static p:Resources.DaysInMonthAt100}" TextWrapping="Wrap" Margin="0,20,0,20" Grid.ColumnSpan="2" Grid.Row="3"/>

                    <TextBlock Text="{x:Static p:Resources.Days}" Margin="0,0,20,0" Grid.Row="1"/>
                    <c:NumericTextBox Text="{Binding SelectedMonth.Tage}" Grid.Row="1" Grid.Column="1"/>


                </Grid>
            </GroupBox>
        </Grid>
        

        <StackPanel Grid.Row="2" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,20,40,20">
            <Button MinWidth="60" Margin="5" IsDefault="True" 
                    Command="{Binding OkCommand}">
                <TextBlock Text="OK"/>
            </Button>
            <Button MinWidth="60" Margin="5" IsCancel="True" 
                    Command="{Binding CancelCommand}">
                <TextBlock Text="Abbrechen"/>
            </Button>
        </StackPanel>

    </Grid>
</c:WindowExt>
